<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>对象的拓展</title>
    <script>
        let user = {
            id: 10086,
            name: "zxy",
            age: 50
        };
        let keys = Object.keys(user);
        let values = Object.values(user);
        console.log(keys);
        console.log(values);
        //user[key]表达的意思：从user对象中根据变量key值作为属性来取值，类似于user.id
        keys.forEach(key => console.log(key + ":" + user[key]));

    </script>
</head>
<body>

</body>
</html>